@tailwind base;
@tailwind components;
@tailwind utilities;

@layer base {
  * {
    @apply border-gray-200 dark:border-gray-700;
    /* 禁用文本选择 */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    
    /* 禁用拖拽 */
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;
  }
  
  body {
    @apply bg-gray-50 text-gray-900 font-sans;
    /* 暗黑模式使用自定义背景色 */
  }
  
  .dark body {
    background-color: #141414;
    color: #f5f5f5;
    font-feature-settings: "rlig" 1, "calt" 1;
    
    /* 禁用触摸缩放 */
    touch-action: manipulation;
    
    /* 禁用双击缩放 */
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
    
    /* 禁用右键菜单 */
    -webkit-context-menu: none;
    
    /* 禁用选择 */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
  }
  
  html {
    /* 禁用触摸缩放 */
    touch-action: manipulation;
    
    /* 禁用双击缩放 */
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
  }
  
  /* 允许特定元素的文本选择（如果需要） */
  input, textarea, [contenteditable="true"] {
    -webkit-user-select: auto;
    -moz-user-select: auto;
    -ms-user-select: auto;
    user-select: auto;
  }
  
  /* 禁用图片拖拽 */
  img {
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;
    pointer-events: none;
  }
  
  /* 禁用链接拖拽 */
  a {
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;
  }
}

@layer components {
  .btn {
    @apply inline-flex items-center justify-center rounded-lg font-medium transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:opacity-50 disabled:pointer-events-none;
    /* 确保按钮不会被双击缩放 */
    touch-action: manipulation;
  }
  
  .btn-primary {
    @apply btn bg-primary-600 dark:bg-primary-700 text-white hover:bg-primary-700 dark:hover:bg-primary-800 focus:ring-primary-500;
  }
  
  .btn-secondary {
    @apply btn bg-transparent border border-gray-600 text-gray-600 hover:bg-gray-100 dark:border-gray-400 dark:text-gray-300 dark:hover:bg-gray-800 focus:ring-gray-500;
  }
  
  .btn-danger {
    @apply btn bg-danger-600 dark:bg-danger-700 text-white hover:bg-danger-700 dark:hover:bg-danger-800 focus:ring-danger-500;
  }
  
  .btn-sm {
    @apply px-3 py-1.5 text-sm;
  }
  
  .btn-md {
    @apply px-4 py-2 text-sm;
  }
  
  .btn-lg {
    @apply px-6 py-3 text-base;
  }
  
  .card {
    @apply bg-white rounded-xl shadow-sm border border-gray-200 p-6;
  }
  
  .dark .card {
    background-color: #141414;
    border-color: #333333;
    /* 确保卡片不会被双击缩放 */
    touch-action: manipulation;
  }
  
  .card-header {
    @apply border-b border-gray-200 dark:border-gray-700 pb-4 mb-4;
  }
  
  .status-indicator {
    @apply w-3 h-3 rounded-full animate-pulse;
  }
  
  .glass-effect {
    @apply backdrop-blur-md bg-white/80 border border-white/20;
  }
  
  .dark .glass-effect {
    background-color: rgba(20, 20, 20, 0.8);
    border-color: rgba(51, 51, 51, 0.2);
  }
  
  /* 禁用用户交互的工具类 */
  .no-select {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
  }
  
  .no-drag {
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;
  }
  
  .no-zoom {
    touch-action: manipulation;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
  }
} 

/* 仅在Windows下隐藏滚动条 */
@media (min-width: 1024px) {
  html.windows body {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE 10+ */
  }
  html.windows body::-webkit-scrollbar {
    display: none; /* Chrome/Safari/Webkit */
  }
} 

/* Windows下全局隐藏所有滚动条（含所有容器） */
html.windows, html.windows body, html.windows * {
  scrollbar-width: none !important; /* Firefox */
  -ms-overflow-style: none !important; /* IE 10+ */
}
html.windows *::-webkit-scrollbar {
  display: none !important; /* Chrome/Safari/Webkit */
}